﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace FrameworkXNA.Scenes
{
    class Som : SceneBase
    {
        Song music;

        SoundEffect soundEffect;

        int contador = 60;

        public override void start()
        {
            music = Game1.instance.Content.Load<Song>("Sleep Away");
            MediaPlayer.Play(music);
            MediaPlayer.IsRepeating = true;

            soundEffect = Game1.instance.Content.Load<SoundEffect>("arma");

            base.start();
        }

        public override void update(GameTime gameTime)
        {
            contador --;

            if (Controller.keyDown(Keys.R))
            {
                if (contador == 0)
                {
                    contador = 60;
                    soundEffect.Play();
                }
                
            }
            
            base.update(gameTime);
        }
    }
}
